﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DOTNETGROUP.Entities;
using DOTNETGROUP.Data;

public partial class Controls_ControlHoTroTrucTuyen : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            HienThiChuyenMucThuNhat();
            HienThiChuyenMucThuHai();
            HienThiChuyenMucThuBa();
            HienThiChuyenMucThuTu();
        }
    }

    private void HienThiChuyenMucThuNhat()
    {
        TList<HoTro> TList_HoTro = DataRepository.HoTroProvider.Find("IdLoaiHoTro=" + 4);
        if (TList_HoTro.Count <= 0) return;
        dlChuyenMuc1.DataSource = TList_HoTro;
        dlChuyenMuc1.DataBind();
    }
    private void HienThiChuyenMucThuHai()
    {
        TList<HoTro> TList_HoTro = DataRepository.HoTroProvider.Find("IdLoaiHoTro=" + 3);
        if (TList_HoTro.Count <= 0) return;
        dlChuyenMuc2.DataSource = TList_HoTro;
        dlChuyenMuc2.DataBind();
    }
    private void HienThiChuyenMucThuBa()
    {
        TList<HoTro> TList_HoTro = DataRepository.HoTroProvider.Find("IdLoaiHoTro=" + 2);
        if (TList_HoTro.Count <= 0) return;
        dlChuyenMuc3.DataSource = TList_HoTro;
        dlChuyenMuc3.DataBind();
    }
    private void HienThiChuyenMucThuTu()
    {
        TList<HoTro> TList_HoTro = DataRepository.HoTroProvider.Find("IdLoaiHoTro=" + 1);
        if (TList_HoTro.Count <= 0) return;
        dlChuyenMuc4.DataSource = TList_HoTro;
        dlChuyenMuc4.DataBind();
    }
}